package moodish.server;

import static org.junit.Assert.*;

import org.junit.Test;

public class UserTest {

	@Test
	public void testGetters() {
		String nickname = "Alice";
		assertNotNull(nickname);
		String mood = "sad";
		User a = new User(nickname);
		a.setMood(mood);
		assertEquals(nickname, a.getNickname());
		assertEquals(mood, a.getMood());
	}
	
	@Test
	public void testBooleanEquals() {
		String nickname1 = "Alice";
		String nickname2 = "Bob";
		assertNotNull(nickname1);
		assertNotNull(nickname2);
		User a = new User(nickname1);
		User b = new User(nickname1);
		User c = new User(nickname2);
		assertEquals(true, a.equals(b));
		assertEquals(false, a.equals(c));
	}

	@Test
	public void testUsertoString() {
		String nickname = "Alice";
		String mood = "sad";
		assertNotNull(nickname);
		assertNotNull(mood);
		User user = new User(nickname);
		user.setMood(mood);
		assertEquals(nickname+":"+mood, user.toString());
	}
}
